package com.example.demo13_printstream;

import java.io.FileOutputStream;
import java.io.PrintStream;

/**
 * 目标：打印流的使用。
 */
public class PrintStreamDemo1 {
    public static void main(String[] args) {
        try (
                // PrintStream ps = new PrintStream("day12-file-io/src/ps.txt");
                PrintStream ps = new PrintStream(new FileOutputStream("day12-file-io/src/ps.txt", true));
                // PrintWriter ps = new PrintWriter("day12-file-io/src/ps.txt");
        ) {
            ps.println(97);
            ps.println('a');
            ps.println("雨");
            ps.println(true);
            ps.println(99.9);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
